package com.larsgard.gedviewer.server.storage;

import java.util.UUID;

import com.larsgard.gedviewer.server.storage.entities.JDOFeedback;

public class FeedbackStorage extends Storage<JDOFeedback> {

    private static FeedbackStorage INSTANCE;

    public static FeedbackStorage getInstance() {
	if (INSTANCE == null) {
	    INSTANCE = new FeedbackStorage();
	}
	return INSTANCE;
    }

    public void persistFeedback(JDOFeedback feedback) {
	if (feedback.getKey() == null) {
	    feedback.setKey(super.createKey(feedback, UUID.randomUUID().toString(), null));
	}
	super.storeObject(feedback);
    }
}
